import http from './index.js'

const getfriends = (data) => {
   return new Promise((resolve, reject) => {
        http.get('/api/friend/getfriend',{params:data}).then(res => {
            resolve(res)
        })
    })
}
const getgountfrient = (data) => {
    return new Promise((resolve, reject) => {
        http.get('/api/friend/getgountfrient',{params:data}).then(res =>{
            resolve(res)
        })
    })
}
const auditFriends =(data)=>{
    return new Promise((resolve,reject)=>{
        http.post('/api/friend/auditFriends',data).then(res=>{
            resolve(res)
        })
    })
}
const searchfriend=(data)=>{
    return new Promise((resolve,reject)=>{
        http.post('/api/friend/searchfriend',data).then(res=>{
            resolve(res)
        })
    })
}
const deleteFriend = (data)=>{
    return new Promise((resolve,reject)=>{
        http.post('/api/friend/deleteFriend',data).then(res=>{
            resolve(res)
        })
    })
}
const updatelinks = (data)=>{
    return new Promise((resolve,reject)=>{
        http.post('/api/friend/updatelinks',data).then(res=>{
            resolve(res)
        })
    })
}
const deleteimg = (data)=>{
    return new Promise((resolve,reject)=>{
        http.post('/api/friend/deleteimg',data).then(res=>{
            resolve(res)
        })
    })
}

export {
    getfriends,
    getgountfrient,
    auditFriends,
    searchfriend,
    deleteFriend,
    updatelinks,
    deleteimg
}
